package club.janna.springboot.controller;

import club.janna.springboot.domain.User;
import club.janna.springboot.service.HelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {

    @Autowired
    private HelloService helloService;

    @GetMapping("hello")
    public String hello() {
        System.out.println("0--------------hello-00-------------");
        return helloService.hello();
    }

    @GetMapping("user")
    public User user() {
        System.out.println("00=--0000----------user ------------");
        return new User(1, "guopanbo", 18);
    }
}
